import { obtainDengesCourse } from '../../../config/api'
import * as actionTypes from './actionTypes';

const getDengesCourse = (data) => ({
	type: actionTypes.Get_Denges_Course,
	data
});

// 获取 今日课程 数据
export const acquireDengesCourseData = ( open_id, batch_id, student_id, union_id ) => {
	return async (dispatch) => {
		const resultInfo = await obtainDengesCourse( open_id, batch_id, student_id, union_id )
		if (resultInfo.status === 200) {
			console.log(resultInfo.data, '获取 今日课程 数据')
			dispatch(getDengesCourse(resultInfo.data));
		}
	}
};